package org.railage.client.filters;

import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.HttpServletResponse;

/**
 * Servlet Filter implementation class ClientIndexFilter
 */
@WebFilter("/client/index.xhtml")
public class ClientIndexFilter implements Filter {

	@Override
	public void destroy() {

	}

	@Override
	public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws IOException, ServletException {
		
		HttpServletResponse httpResp = (HttpServletResponse) resp;		
		httpResp.sendRedirect("/railage-web/client/trip-search.xhtml");
	}

	@Override
	public void init(FilterConfig config) throws ServletException {
		
	}

}
